﻿<%@ Page Title="كل الجهات" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="AllCompanies.aspx.cs" Inherits="AllCompanies" meta:resourcekey="PageResource1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/CustomerInfo.ascx" TagName="CustomerInfo" TagPrefix="CI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="jqModal.css" rel="stylesheet" type="text/css" />

   <%-- <script src="jquery-1.3.2.min.js" type="text/javascript"></script>--%>
    <script src="jqModal.js" type="text/javascript"></script>
    <script type="text/javascript">

    function there() {

        $("#dialog").jqm({ modal: true }).jqmShow();


    }
    
      </script>
      <style type="text/css">
         
  .newzr3{
	background:  url('images/Untitled-2_03.png') right ;

	height:34px;
	 background-repeat:no-repeat;
	 float:left;
	 margin-top:-5px;
	 text-align: center;
	 padding-right:15px;
	 cursor:pointer;
	 font-family:Tahoma;
	 font-size:14px;
	 color:#003353;
	 text-decoration:none;
	 
}
.newzr3:hover{
	color: #00b4ff;
	background-image:url('images/Untitled-2ho_03.png');
	background-repeat:no-repeat;

} 
        	
        	.zr3 {
	background-image:url('images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 17%;
    left: 50%;
    
    margin-left: -300px;
    width: 823px;
    
    background-color: #EEE;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
            </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div dir="rtl">
        <asp:UpdatePanel ID="up1" runat="server" ChildrenAsTriggers="true" >
            <ContentTemplate>
            <div  align="right">
            
<table width="100%" style="padding:10px;" dir="rtl">
<tr>
   
<td style="padding:5px; width:130px;" >

    

    <asp:Label ID="Label4" CssClass="stylelabel3" runat="server" Text="كلمة البحث" meta:resourcekey ="Searchkey"></asp:Label>

    

</td>
<td style="padding:5px; width:200px;">
   <asp:TextBox ID="searchfield" runat="server" CausesValidation="True" 
        style="border: solid 1px black;" Width="150px"></asp:TextBox>

</td>
<td >

    
    
</td>
<%--<td>
<a href="#" id="lblasearch" onclick="there();" >بحث متقدم</a>
</td>--%>

</tr>
<tr>
<td style="padding:5px; width:130px;">
    <asp:Label ID="Label5" CssClass="stylelabel3" runat="server" Text="موضع البحث" meta:resourcekey="Searchtype"></asp:Label>
    </td>
<td style="padding:5px; width:200px;"> 
    <asp:DropDownList ID="DropDownList2" runat="server" 
        style="border:solid 1px black;" Width="150" >
       
          <asp:ListItem Selected="True" Value="0" meta:resourceKey="All">الكل</asp:ListItem>
        <asp:ListItem Value="address"  meta:resourceKey="lbladress" >العنوان</asp:ListItem>
        <asp:ListItem Value="company" meta:resourceKey="lblcname">اسم الجهة</asp:ListItem>
        <asp:ListItem Value="companydesc" meta:resourceKey="desc">وصف الجهة</asp:ListItem>
        <asp:ListItem Value="email1" meta:resourceKey="email">الايميل</asp:ListItem>
       
    </asp:DropDownList></td>
<td>
    <asp:Button ID="Button1" runat="server" CssClass="zr3" 
        onclick="ImageButton1_Click"  Text="إبحث" meta:resourcekey="searchButton" />
    </td>
</tr>
<tr>

<td colspan="3">
    <br />
    <asp:Label ID="Label1" runat="server" ForeColor="#FF3300" 
        Text="<%$ Resources:Resource, searchresult %>" Visible="False"></asp:Label>
    
    </td>
</tr>
</table>

<table  width ="100%" dir="ltr">
<tr>
<td style=" padding:5px;">
    <asp:LinkButton Height="19px"  ID="LinkButton1" CssClass="newzr3" runat="server" Text="اضافة جهة جديدة" PostBackUrl="NewCustomer.aspx" meta:resourcekey="addnew"></asp:LinkButton>
</td>
</tr>
</table>

 </div>

                <div >
                <table class="tab3">
                    <tr>
                    <td colspan="2" class="he3">
                                                    <asp:Label  ID="lblfilter"  runat="server" Text="فلترة الجهات" meta:resourceKey="lblfilter" />

                    </td>
                    </tr>
                    
                    <tr>
                    <td class="tabbone3">
                                              <asp:Label ID="lblttype" runat="server" meta:resourceKey="lbltype" 
                               Text="النوع" />
 
                    </td>
                    <td class="tabbone3">
                                        
                                               <asp:Label ID="lblstatus" runat="server" meta:resourceKey="lblsubs" 
                               Text="الحالة" />

                    </td>
                    </tr>
                    
                    <tr>
                    <td class="adel3">
                                                               <asp:DropDownList style="border:solid 1px black" ID="act" runat="server" DataSourceID="S1" DataTextField="organization"
                                  DataValueField="id" AutoPostBack="true" 
                                    onselectedindexchanged="act_SelectedIndexChanged" 
                                    AppendDataBoundItems="True" >
                                    <asp:ListItem Value="0" meta:resourceKey="all" Text="الكل"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="S1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                    SelectCommand="SELECT * FROM [organizations]"></asp:SqlDataSource>


</td>
                    <td class="adel3">                                               
                                <asp:DropDownList style="border:solid 1px black" ID="allcompanies" runat="server" 
                                     
                                    
    onselectedindexchanged="comps_SelectedIndexChanged" AutoPostBack="true" 
                                    AppendDataBoundItems="True" >
                                    <asp:ListItem Value="-1" meta:resourceKey="all" Text="الكل"></asp:ListItem>
                                     <asp:ListItem Value="0" meta:resourceKey="stop" Text="موقوف"></asp:ListItem>
                                       <asp:ListItem Value="1" meta:resourceKey="active" Text="فعال"></asp:ListItem>
                                </asp:DropDownList>
 </td>
                    </tr>
                    </table>
                 <br />
                    <table width="540px" dir="rtl">
                       
                        <tr>
                        <td colspan="5">
                        
                       
                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                AutoGenerateColumns="False" Font-Bold="False" Font-Names="Arabic Typesetting" 
                                onrowcreated="GridView1_RowCreated" onrowdatabound="GridView1_RowDataBound" 
                                Width="16px" GridLines="None">
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            <div dir="rtl">
                                                <table  class="tab3" >
                                                    <tr>
                                                        <td class="tabbone3" style=" width:100px">
                                                            <asp:Label ID="lblcname" runat="server" meta:resourceKey="lblcname" 
                                                                Text="اسم الجهة" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:200px">
                                                            <asp:Label ID="lbladress" runat="server" meta:resourceKey="lbladress" 
                                                                Text="العنوان" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:70px">
                                                            <asp:Label ID="lblcity" runat="server" meta:resourceKey="lblcity" 
                                                                Text="المدينة" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:70px">
                                                            <asp:Label ID="lbltype" runat="server" meta:resourceKey="lbltype" 
                                                                Text="نوع الجهة" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:70px">
                                                            <asp:Label ID="lblphone" runat="server" meta:resourceKey="lblphone" 
                                                                Text="الهاتف" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:45px">
                                                            <asp:Label ID="lblshow" runat="server" meta:resourceKey="lblshow" Text="عرض" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:45px">
                                                            <asp:Label ID="lbledit" runat="server" meta:resourceKey="lbledit" 
                                                                Text="تعديل" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:70px">
                                                            <asp:Label ID="lblsubs" runat="server" meta:resourceKey="lblsubs" 
                                                                Text="الاشتراكات" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:45px">
                                                            <asp:Label ID="lbldelete" runat="server" meta:resourceKey="lbldelete" 
                                                                Text="حذف" />
                                                        </td>
                                                        <td class="tabbone3" style=" width:70px">
                                                            <asp:Label ID="lblstop" runat="server" meta:resourceKey="lblstop" 
                                                                Text="تفعيل/ايقاف" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Panel ID="Panel9" runat="server" Direction="RightToLeft">
                                                <table class="tab3" >
                                                    <tr>
                                                        <td class="adel3" style=" width:100px">
                                                            <asp:Label ID="co" runat="server"  
                                                                Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("company"))) %>' />
                                                        </td>
                                                        <td class="adel3" style=" width:200px">
                                                            <asp:Label ID="add" runat="server"
                                                                Text='<%# String.Format("{0} , {1}",Eval("address"),Eval("district")) %>' />
                                                        </td>
                                                        <td class="adel3" style=" width:70px">
                                                            <asp:Label ID="city" runat="server" Text='<%# Eval("city") %>' />
                                                        </td>
                                                        <td class="adel3" style=" width:70px">
                                                            <asp:Label ID="Label2" runat="server" 
                                                                Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("organization"))) %>' />
                                                        </td>
                                                        <td class="adel3" style=" width:70px">
                                                            <asp:Label ID="phone" runat="server"  
                                                                Text='<%# String.Format("{0} , {1}",Eval("tele1"),Eval("tele2")) %>' />
                                                        </td>
                                                        <td class="adel3" style=" width:45px">
                                                            <asp:LinkButton ID="display" runat="server" 
                                                                CommandArgument='<%# String.Format("{0} , {1},{2},{3},{4}", Eval("companydesc"), Eval("country"), Eval("longitude"),Eval("latitude"),Eval("email1")) %>' 
                                                                meta:resourceKey="lblshow" OnClick="display_Click" Text="عرض"></asp:LinkButton>
                                                        </td>
                                                        <td class="adel3" style=" width:45px">
                                                            <asp:HyperLink ID="edits" runat="server" meta:resourceKey="lbledit" 
                                                                NavigateUrl='<%# this.ResolveUrl("~/" + string.Format("EditCompany.aspx?cusid={0}",Eval("id"))) %>' 
                                                                Text="تعديل" />
                                                        </td>
                                                        <td class="adel3" style=" width:70px">
                                                            <asp:HyperLink ID="HyperLink1" runat="server" meta:resourceKey="lblsubs" 
                                                                NavigateUrl='<%# this.ResolveUrl("~/" + string.Format("Subscriptions.aspx?company={0}",Eval("id"))) %>' 
                                                                Text="الاشتراكات" />
                                                        </td>
                                                        <td class="adel3" style=" width:45px">
                                                            <asp:LinkButton ID="delete" runat="server" 
                                                                CommandArgument='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("user_id"))) %>' 
                                                                meta:resourceKey="lbldelete" OnClick="delete_Click" Text="حذف" 
                                                                ToolTip='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("id"))) %>'></asp:LinkButton>
                                                        </td>
                                                        <td class="adel3" style=" width:70px">
                                                            <asp:LinkButton ID="actstop" runat="server" 
                                                                CommandArgument='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("active"))) %>' 
                                                                OnClick="stop_Click" Text="تفعيل/ايقاف" 
                                                                ToolTip='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("id"))) %>'></asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                                                    ConfirmText="<%$ Resources:Resource, delconfirm %>" TargetControlID="delete" />
                                                <asp:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" 
                                                    ConfirmText="<%$ Resources:Resource, stopconfirm %>" 
                                                    TargetControlID="actstop" />
                                            </asp:Panel>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                 </td>
                        </tr>
                     <tr>
                     <td colspan="5">
                     <div id="displays" align="right" runat="server" visible="false">
                  
<CI:CustomerInfo ID="CustomerInfo1" runat="server"   />
                    
                
                </div>
                     </td>
                     </tr>
                    </table>
                </div>
                
                    
    
            
    
    </ContentTemplate>
       
          </asp:UpdatePanel>
          </div>
  <%--  <div class="jqmWindow" id="dialog">

<a href="#" class="jqmClose" style="background-image:url('images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>
<hr />

  <FC2:FilterCustomer2 ID="FilterCustomer1" runat="server"  Showbtn="false"  />
  <hr />
    <asp:Button ID="saves" runat="server" Text="اختيار" 
           Font-Bold="True" Font-Size="Medium" onclick="saves_Click" />
     </div>--%>
    
    <asp:SqlDataSource ID="CusSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT * FROM [companies]"></asp:SqlDataSource>
</asp:Content>

